import type { Rule } from 'ant-design-vue/lib/form'

export const formRule: Record<string, Rule[]> = {
  title: [
    {
      required: true,
      message: '请输入菜单标题',
      trigger: 'blur'
    }
  ],
  name: [
    {
      required: true,
      message: '请输入菜单名',
      trigger: 'blur'
    }
  ],
  path: [
    {
      required: true,
      message: '请输入路由路径',
      trigger: 'blur'
    },
    {
      pattern: /^\//,
      message: '路由路径必须以/开头',
      trigger: 'blur'
    }
  ],
  perms: [
    {
      required: true,
      message: '请输入权限标识',
      trigger: 'blur'
    }
  ],
  icon: [
    {
      required: true,
      message: '请选择菜单图标',
      trigger: 'blur'
    }
  ]
}
